/* ************************************** */
/* * Rand Library for Threaded Programs * */
/* ************************************** */

#ifndef RAND_H
#define RAND_H

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>

struct BoxMullerState
{
        double x1, x2, w, y1, y2;
        int useLast;
        struct drand48_data random;
};

/* Get next random number using a seed/previous number */
unsigned int randNext(unsigned int x);

/* Initialise BoxMullerState */
void initBoxMullerState(struct BoxMullerState* state);

/* Get a BoxMullerStateRandom */
double boxMullerRandom(struct BoxMullerState* state);

#endif